#include <cstdio>
#include <cmath>

#define MAX_SIZE 10000

int a[MAX_SIZE] = {0};

void prime() {
	int i, j;
	int count = 1;
	for (i = 2; i <= 100000; i++)
    {
        for (j = 2; j <= sqrt(i); j++)
            if (i % j == 0)
                break;
        if (j > sqrt(i))
            a[count++] = i;
    }
}

int main() {
	prime();
	int n;
	while (scanf("%d", &n) == 1) {
		printf("%d\n", a[n]);
	}


	return 0;
}